package com.qfedu.edu.orderservice.config;

import com.qfedu.edu.orderservice.interceptor.GlobalInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * @author xiaobobo
 * @title: AppConfig
 * @projectName seckill-fy-2401-parent
 * @description: TODO
 * @date 2024/11/11  11:45
 */
@SpringBootConfiguration
@ComponentScan(basePackages = {"com.qfedu.edu"})
public class AppConfig extends WebMvcConfigurationSupport {

    @Autowired
    private GlobalInterceptor globalInterceptor;

    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(globalInterceptor)
                .addPathPatterns("/orderservice/order/createOrder");
    }
}
